<template>
    <div class="new">
        <h2>{{newlist.title}}</h2>
            <div @click="hankdetail(data.id)" class="image" v-for="data in newlist.list" :key="data.id" :style="{backgroundImage:'url('+data.img+')'}">
                <div class="fs24">{{data.name}}</div>
                <div class="fs12">{{data.desc}}</div>
                <div class="fs16">￥ {{data.price}}</div>
                <span>去购买></span>
            </div>
    </div>
</template>
<script>
export default {
  props: {
    newlist: {
      type: Object
    }
  },
  methods: {
    hankdetail (id) {
      this.$router.push({ path: '/pages/detail/detail', query: { id: id } })
    }
  }
}
</script>
<style lang="scss" scoped>
    .new{
        margin-top: 160px;
        h2{
            font-size: 18px;
            line-height: 40px;
        }
        .image{
            margin-bottom: 10px;
            padding: 24px;
            height: 400px;
            overflow: hidden;
            background-position: 0 0 ;
            background-size: cover;
            color: #fff;
            position: relative;
            div{
                margin-bottom: 6px;
            }
            .fs24{
                font-size: 24px;
            }
            .fs16{
                font-size: 16px;
            }
            .fs12{
                font-size: 12px;
            }
            span{
                padding:0 5px 0 7px;
                border-radius: 30px;
                font-size: 12px;
                border: 1px solid #fff;
                position: absolute;
                bottom: 20px;
                right: 20px;
                }
        }
    }
    .new>div:nth-of-type(2){
        color: #000;
    }
    .new>div:nth-of-type(3).image{
        color: #045D4e;
    }
    .new>div:nth-last-of-type(1).image{
        color: #900014;
    }
</style>
